public class Test {
    static int count = 0;
    public static void main(String[] args) throws InterruptedException {
        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                for(int i=0;i<5000;i++) {
                    count++;
                }
            }
        };
        Thread t = new Thread(runnable);
        t.start();
        t.join();
        System.out.println(count);

    }
    public static void main1(String[] args) throws InterruptedException {
        Thread t = new Thread(new Runnable() {
            @Override
            public void run() {
                for(int i=0;i<5000;i++) {
                    count++;
                }
            }
        });
        t.start();
        t.join();
        System.out.println(count);
    }
}
